package com.serviceprovider.business.module.admin.role.model;

//~--- non-JDK imports --------------------------------------------------------

import com.serviceprovider.business.module.admin.user.model.Saveable;

/**
 * Authority domain object. Holds one or more authorities for user. Used for
 * authorization purposes.
 */
public class Role extends Saveable {
    private static final long serialVersionUID = -5107773660631193390L;
    private boolean           active           = true;
    private String            comments;
    private String            description;
    private String            name;

    public String getName() {
        return name;
    }

    public void setName(String n) {
        this.name = n;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public boolean isActive() {
        return active;
    }

    public void setActive(boolean active) {
        this.active = active;
    }

    public String getComments() {
        return comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }

    @Override
    public boolean equals(Object obj) {
        if ((obj == null) ||!(obj instanceof Role)) {
            return false;
        }

        Role b = (Role) obj;

        return ((id == null) && (b.id == null)) || ((id != null) && id.equals(b.id));
    }

    @Override
    public int hashCode() {
        return (id != null)
               ? id.hashCode()
               : 0;
    }
}



